package com.tedu.api.ee;

import org.junit.Test;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class HomeWork {


@Test
        public void ee()  {


    try {
//        //NumberFormatException
        String s="Yes";
        s.charAt(5);
//
//
//        //ArithmeticException   运算错误:数字不可以除以0
//
        int a = 11;
        int b = 0;
        System.out.println(a / b);


//            //ArrayStoreException   存储数据类型异常
        Object[] objs=new String[6];
        objs[0]=new Integer(4);
        System.out.println(objs);


// FileNotFoundException   文件不存在异常
        FileReader fr=new FileReader("lhm.txt");


        //ArrayIndexOutOfBoundsException
        int[] arr = {1, 2, 3,4,5};
        System.out.println(arr[6]);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (NumberFormatException e) {
        e.printStackTrace();
    }catch (ArithmeticException e) {
        e.printStackTrace();
    }catch (ArrayStoreException e) {
        e.printStackTrace();
    }catch (ArrayIndexOutOfBoundsException e) {
        e.printStackTrace();
    }
    finally {
    }


}


    }

